<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php

class ApiErrorLogListDataProvider extends CMiniyunActiveDataProvider
{
	private $_list;
	
	public function getData($refresh=false){
		if($this->_list===null || $refresh){
			$this->model = new APIErrorLog();			$this->initData();						$data = array();
			foreach($this->data as $index=>$logItem){
				$item = new ApiErrorLogBase();
				$item->id        = $logItem["id"];
				$item->namespace = $logItem["namespace"];
				$item->memo      = $logItem["memo"];
				$item->appId     = $logItem["appliction_id"];
				$item->createdAt = $logItem["created_at"];
				$apps = ServerRegistry::getApps();
				if(array_key_exists($item->appId, $apps)){
					$item->appName=$apps[$item->appId];
				}else{
					$item->appName=$apps[8];				}
				array_push($data,$item);
			}
			$this->_list =  $data;
		}
		return $this->_list;
	}


}